 exports = function (model) {

     var VUE = vue;
     if (model.operations) {
         model.operations.loading = {
             "icon": "el-icon-loading",
             "Style": "success",
             "Filter": "row.state==-1"
         }
     }
     for (var key in model) {
         this[key] = model[key];
     }

     this.ID = vue.ID = vue.$RandomString(32);

     vue.UIEventPool.add("webos-plugin-management", "update-data", function (row) {

         vue.UIEventPool.run(self.ID, "Uploaded-Row", row)
     });

     var UI = null;
     this.extends = function (ui) {
         UI = ui;
         console.log(UI);
     } 
     this.Click = function (val, T) {

         var setserver = function (off) {
             if (!off) {
                 return;
             }
             VUE.$Ajax(Url, obj).then(function (response) {
                 if (response.data && response.data) {
                     var code = response.data;
                     if (code.AppsInitFunctions && VUE.$AppsInitFunctions.Run) {
                         VUE.$AppsInitFunctions.Run(code.AppsInitFunctions);
                     }
                 }
                 if (UI) {
                     UI.loadingSwitch = false;
                 }
             });

         }

         var off = false;
         if (UI) {
             UI.loadingSwitch = true;
         };
         var obj = {
             id: val.id
         };
         var Url = VUE.$Uris.PluginRemove;
         if (T.__id == "remove") {

             val.state = -1
             Url = VUE.$Uris.PluginRemove;
             VUE.$confirm(VUE.$getTitle("@this_remove_plugin"), VUE.$getTitle("@sys_prompt"), {
                 confirmButtonText: VUE.$getTitle('@sys_ok'),
                 cancelButtonText: VUE.$getTitle('@sys_cancel'),
                 type: 'warning'
             }).then(function () {
                 off = true;
                 setserver(off);
             }).catch(function () {
                 off = false
             });
         } else if (T.__id == "uninstall") {
             Url = VUE.$Uris.PluginUninstall;
             off = true;

             val.state = -1
             setserver(off);

         } else if (T.__id == "install") {
             Url = VUE.$Uris.PluginInstall;
             off = true;

             val.state = -1
             setserver(off);
         } else if (T.__id == "cloud-install") {
             obj = {
                 appid: val.appid
             };
             Url = VUE.$Uris.PluginInstall;
             off = true;

             val.state = -1
             setserver(off);
         }else if (T.__id == "cloud-install") {
            obj = {
                appid: val.appid
            };
            Url = VUE.$Uris.PluginInstall;
            off = true;

            val.state = -1
            setserver(off);
        }else if (T.__id == "cloud-refresh") {
            obj = {
                appid: val.appid
            };
            Url = VUE.$Uris.PluginInstall;
            off = true;
            val.state = -1
            setserver(off);
        }
        

     }
     var self = this;
 }